<?php
header("content-type:text/html;charset=utf-8");
$sdn=("mysql:host=127.0.0.1;dbname=myexam;charset=utf8");
$pdo=new PDO($sdn,'root','root');
$sql="select * from pro";
$res-$pdo->query($sql)->fetchAll(PDO::FETCH_ASSOC);


$starttime=$res[0]['starttime'];
$starttime=strtotime($starttime);
$time=$starttime-time();
$hour=floor($time/3600);
$min=floor(($time-$hour*3600)/60);
$sec=$time-$hour*3600-$min*60;
echo json_encode(array('hour'=>$hour,'min'=>$min,'sec'=>$sec));






